#include "Vector.h"


Vector::Vector(void)
{
	_x = _y = 0;
}

Vector::Vector(float x, float y)
{
	_x = x;
	_y = y;
}

Vector::Vector(const Vector &v)
{
	_x = v._x;
	_y = v._y;
}

Vector::~Vector(void)
{
}

bool Vector::isZero()
{
	return (_x==0 && _y==0);
}

float Vector::getX()
{
	return _x;
}

float Vector::getY()
{
	return _y;
}

float Vector::Length()
{
	return sqrt(_x*_x + _y*_y);
}

Vector Vector::Normalise()
{
	float f = Length();
	if (f == 0) return Vector();
	return (*this * (float)(1/f));

}